home *** CD-ROM | disk | FTP | other *** search
- Path: news.sprintlink.net!datalytics!news
- From: Rob Stewart <stew@datalytics.com>
- Newsgroups: comp.lang.c++
- Subject: Re: Strange (to me) notation - little help?
- Date: 4 Jan 1996 21:35:02 GMT
- Organization: Datalytics, Inc
- Message-ID: <4chh66$ldg@gold.datalytics.com>
- References: <30EB32AC.2836@sierra.net>
- NNTP-Posting-Host: pc071.datalytics.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.22 (Windows; I; 32bit)
-
- "Tyler G. Colwell" <snowbull@sierra.net> wrote:
- >I am reading Jesse Liberty's "Teach Yourself C++ in 21 Days" and have come across some notation that I can't
- >find explained anywhere. Here is a code fragment of a
- [snip]
- > SimpleCat::SimpleCat(int age, int weight):
- > itsAge(age), itsWeight(weight) {}
- >***********************************************
- >
- >Wow, those last two lines are dumbfounding. What is the colon at the end of that one line for, and what's up
- >with using members itsAge and itsWeight as functions in the last line, and howcome none of them are inside the
- >braces?
- >
-
- What you're looking at is an initializer list. There is a
- thread in comp.lang.c++ discussing them.
-
- --
- Robert Stewart | My opinions are usually my own.
- Datalytics, Inc.
- (513)226-7700
- stew@datalytics.com
-
-
-